import { IsString } from "class-validator";
import { BaseEntity } from "../BaseEntity";
import { Model } from "sequelize";

export default class CatteryEntity extends BaseEntity {
  id?: number;

  @IsString()
  public name: string;

  @IsString()
  public imgUrl: string;

  @IsString()
  public type: string;

  public static transform(plainObject: object): CatteryEntity {
    return super.baseTransform(CatteryEntity, plainObject);
  }
}

export interface ICatteryModel extends Model<CatteryEntity> { }

/**
 * 导入的字段映射对象
 */
export const importFieldMap: Omit<CatteryEntity, "validateThis"> = {
  name: "name", imgUrl: "imgUrl",
  type: "type"
};
